package edu.harvard.eecs.airg.coloredtrails.controller;

import edu.harvard.eecs.airg.coloredtrails.controller.events.GameStartEventListener;
import edu.harvard.eecs.airg.coloredtrails.shared.types.GameStatus;

/**
 * @author Rani
 */
public class CodeController extends Thread implements GameStartEventListener {

    public CodeController(String config) {
    }

    public void run() {
        System.out.println("Code Controller starting");
        ControlImpl controlImpl = new ControlImpl("tcp://127.0.0.1:8081");
        controlImpl.sendConfig("gameconfigs", "TheAutomatConfig");
        controlImpl.newGame("TheAutomatConfig", "10 20");
        controlImpl.addGameStartEventListener(this);
    }

    public void gameStarted(GameStatus game){
        System.out.println("Game has started id=" + game.getGameId());        
    }

}
